/* 注册 */
function getverifycode2() {
	var mobile =  $('#username').val();

	if(mobile == '') {
		msgs("手机号不能为空！");
		$("#username").focus();
		return;
	}
	Ajax.call('user.php?act=getverifycode2&r=' + Math.random(), 'mobile=' + mobile , getverifycode2Response, 'POST', 'JSON');
}
/* 手机号登录 */
function getverifycode3() {
	var mobile =  $('#user_name').val();

	if(mobile == '') {
		msgs("手机号不能为空！");
		$("#user_name").focus();
		return;
	}
	Ajax.call('user.php?act=getverifycode2&r=' + Math.random(), 'mobile=' + mobile +'&type=2' , getverifycode2Response, 'POST', 'JSON');
}

/* 修改 登录密码  */
function getverifycode4() {
	var mobile =  $('#tel').val();

	if(mobile == '') {
		msgs("手机号不能为空！");
		$("#tel").focus();
		return;
	}
	Ajax.call('user.php?act=getverifycode2&r=' + Math.random(), 'mobile=' + mobile +'&type=3' , getverifycode2Response, 'POST', 'JSON');
}
/*  修改 支付密码  */
function getverifycode5() {
	var mobile =  $('#tel').val();

	if(mobile == '') {
		msgs("手机号不能为空！");
		$("#tel").focus();
		return;
	}
	Ajax.call('user.php?act=getverifycode2&r=' + Math.random(), 'mobile=' + mobile +'&type=4' , getverifycode2Response, 'POST', 'JSON');
}
/*   提现短信  */
function getverifycode7() {
	var mobile =  $('#tel').val();

	if(mobile == '') {
		msgs("手机号不能为空！,请绑定手机号之后在来提现");
		$("#tel").focus();
		return;
	}
	Ajax.call('user.php?act=getverifycode2&r=' + Math.random(), 'mobile=' + mobile +'&type=7' , getverifycode2Response, 'POST', 'JSON');
}
function getverifycode1Response(result) {
	if (result.error==0){
		RemainTime();		
	}
	msgs(result.message);
}

function getverifycode2Response(result) {
 
	if (result.error==0){
		RemainTime();		
	}
	
	msgs(result.message);
}
var ztime = $('#dayu_sms_smsgap').val();
if(!ztime || ztime == 'undefined'){
	var ztime = 120;
}

var iTime = parseInt(ztime)-1;
var Account;
function RemainTime(){
	document.getElementById('zphone').disabled = true;
	var iSecond,sSecond="",sTime="";
	if (iTime >= 0){
		iSecond = parseInt(iTime%60);
		iMinute = parseInt(iTime/60)
		if (iSecond >= 0){
			if(iMinute>0){
				sSecond = iMinute + "分" + iSecond + "秒";
			}else{
				sSecond = iSecond + "秒";
			}
		}
		sTime=sSecond;
		if(iTime==0){
			clearTimeout(Account);
			sTime='获取手机验证码';
			iTime = parseInt(ztime)-1;
			document.getElementById('zphone').disabled = false;
		}else{
			Account = setTimeout("RemainTime()",1000);
			iTime=iTime-1;
		}
	}else{
		sTime='没有倒计时';
	}
	document.getElementById('zphone').value = sTime;
}